package com.xbenben.demoroot.controller;

import com.xbenben.demoroot.bean.User;
import com.xbenben.demoroot.demo.Zoo;
import com.xbenben.demoroot.service.RegSyncService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author xbenbenx
 * Date:2022/10/12 22:52
 **/
@RestController
@RequestMapping("/demo")
@Slf4j
public class DemoController {

    public static final String COUNT = "count";
    private static final ConcurrentHashMap<String, User> count = new ConcurrentHashMap<>();

    static {
        count.put(COUNT, new User(1));
    }

    @Autowired
    private RegSyncService regSyncService;
    @Autowired
    @Qualifier("Dog")
    private Zoo zoo;

    public static void main(String[] args) {
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put(null, null);
        stringStringHashMap.put(null, null);
        System.out.println(stringStringHashMap);
    }

    @GetMapping("/de1")
    public String demo_01() {
        zoo.getFood();
        return "测试";
    }

    @GetMapping("/de2")
    public String demo_02() {
        zoo.getFood();
        return "测试";
    }

}
